<?php

namespace App\Events\Cruise\CruiseOrder;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

/**
 * 稽核表单状态扭转事件
 */
class CruiseOrderStatusChangeEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * cruise_order.id
     *
     * @var int
     */
    public int $cruiseOrderId;

    /**
     * cruise_order.status
     *
     * @var int
     */
    public int $status;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct(int $cruiseOrderId, int $status)
    {
        $this->cruiseOrderId = $cruiseOrderId;
        $this->status        = $status;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
